﻿<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:voc="clr-namespace:ViewOn.UI.Control">

	<ResourceDictionary.MergedDictionaries>
		<ResourceDictionary Source="..\Shared.xaml" />
	</ResourceDictionary.MergedDictionaries>

	<!-- TextBoxBase -->

	<Style x:Key="{x:Type TextBox}" TargetType="{x:Type TextBox}">
		<Setter Property="SnapsToDevicePixels" Value="True"/>
		<Setter Property="OverridesDefaultStyle" Value="True"/>
		<Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
		<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
		<Setter Property="MinWidth" Value="20"/>
		<Setter Property="MinHeight" Value="14"/>
		<Setter Property="AllowDrop" Value="true"/>
		<Setter Property="Background" Value="{DynamicResource VOColor10}"/>
		<Setter Property="Foreground" Value="{DynamicResource VOColorText}"/>
		<!--Setter Property="UndoLimit" Value="0" /-->
		<!-- Allow carret color to be white -->
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type TextBoxBase}">
					<Border
								Name="Border"
								Padding="1"
								Background="{DynamicResource VOColor11}"
								BorderBrush="{DynamicResource VOColor14}"
								CornerRadius="1"
								BorderThickness="1" >
						<ScrollViewer Margin="0" x:Name="PART_ContentHost"/>
					</Border>
					<ControlTemplate.Triggers>
						<!--Trigger Property="IsEnabled" Value="False">
							<Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}"/>
							<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}"/>
							<Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
						</Trigger-->
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>

		<!--Style.Triggers>
			<DataTrigger Binding="{Binding Path=IsLoaded, RelativeSource={RelativeSource Self}}" Value="True">
				<Setter Property="UndoLimit" Value="0" />
			</DataTrigger>
		</Style.Triggers-->
	</Style>

	<!-- SimpleStyles: RichTextBox -->

	<!--Style x:Key="{x:Type RichTextBox}"
       BasedOn="{StaticResource {x:Type TextBox}}"
       TargetType="{x:Type RichTextBox}">
    <Setter Property="TextWrapping"
        Value="Wrap"/>
    <Style.Resources>
      <Style x:Key="{x:Type FlowDocument}"
           TargetType="{x:Type FlowDocument}">
        <Setter Property="OverridesDefaultStyle"
            Value="true"/>
      </Style>
    </Style.Resources>
  </Style-->

	<!-- PasswordBox -->

	<Style x:Key="{x:Type PasswordBox}" TargetType="{x:Type PasswordBox}">
		<Setter Property="SnapsToDevicePixels" Value="true"/>
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
		<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
		<Setter Property="FontFamily" Value="Verdana"/>
		<Setter Property="PasswordChar" Value="●"/>
		<Setter Property="MinWidth" Value="120"/>
		<Setter Property="MinHeight" Value="20"/>
		<Setter Property="AllowDrop" Value="true"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type PasswordBox}">
					<Border
					  Name="Border"
					  CornerRadius="2"
					  Padding="2"
					  Background="{StaticResource WindowBackgroundBrush}"
					  BorderBrush="{StaticResource SolidBorderBrush}"
					  BorderThickness="1" >
						<ScrollViewer x:Name="PART_ContentHost" />
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsEnabled" Value="False">
							<Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}"/>
							<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}"/>
							<Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>


</ResourceDictionary>